using UnityEngine;

public class ZombieAttractor : MonoBehaviour
{
	public float attractChance = 0.1f;

	public float attractInterval = 1f;

	public bool forHuman;

	public bool forDog;

	private void Awake()
	{
		InvokeRepeating("AttractZombies", attractInterval, attractInterval);
	}

	private void AttractZombies()
	{
		foreach (Zombie zombie in CampaignGame.Instance.zombies)
		{
			if (zombie.isDog == forDog && (forHuman || zombie.isDog) && zombie.randomSeed < attractChance && zombie.tmpTarget == null)
			{
				zombie.tmpTarget = base.gameObject;
			}
		}
	}
}
